#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2021/7/5
# @Author  : LiJun
# @Email   : lijun@tianyancha.com
# @Version : 1.0.0
import allure

from common.appium_base_method import BasePage

class EditPersonal(BasePage):

    @allure.step("点击「删除」按钮")
    def del_personal_button(self, delete=True):
        """
        :param delete: bool，点击按钮行为，默认为Ture点击确认，Flash点击取消
        :return:
        """
        # 删除成员
        self.swipt_find(*self.by_maps(self.element["PersonalDelButton"])).click()
        # self.find_click(*self.by_maps(self.element[" PersonalDelButton"]))

        if delete:
            with allure.step("点击「确定」"):
                self.find_click(*self.by_maps(self.element["PopButton"]))

            from appium_0704.page.address_book_page import AddressBook
            return AddressBook(self.driver, element=self.element)
        else:
            with allure.step("点击「取消」"):
                self.find_click(* self.by_maps(self.element["PopCancelButton"]))



